package com.hopes.bizz.risk.transfer.converter;

import com.hopes.bizz.risk.control.entity.RiskUnitStopEntity;
import com.hopes.bizz.risk.transfer.bean.dto.RiskUnitStopDto;
import org.mapstruct.BeanMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface RiskUnitStopConverter {

    RiskUnitStopConverter INSTANCE = Mappers.getMapper(RiskUnitStopConverter.class);

    @Mapping(target = "uid", source = "id")
    @Mapping(target = "createTime", source = "createDate", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "createBy", source = "createBy")
    @Mapping(target = "updateTime", source = "updateDate", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "updateBy", source = "updateBy")
    @Mapping(target = "stopStartTime", source = "stopStartTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "stopEndTime", source = "stopEndTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "stopReason", source = "stopReason")
    @BeanMapping(ignoreByDefault = true)
    RiskUnitStopEntity toEntity(RiskUnitStopDto riskUnitStopDto);
}
